Welcome to Stat 220

Day 01

Prof Emily Kurtz

Carleton College
Stat 220 - Spring 2026

Intros

About me

  • First year at Carleton!
  • PhD in Political Science from the University of Minnesota
  • M.S. in Statistics from UMN
  • Originally from(ish) Cleveland, Ohio
  • Went to Wellesley College for undergrad
  • Have an almost 2 year old toddler named Glenn
  • Like to walk around lakes, bike, and try out local restaurants

In groups of 5ish

To get to know you all better, you will make a dataset about yourselves to share with the class. You have 30 minutes to do so. You should hit on the following buckets:

  1. Describe your data: What are you interested in describing as part of your dataset? What are you not?
  2. Collect: Gather your data in one place
  3. Clean: Edit the dataset so that it’s in a presentable, clean format
  4. Analyze: What stories are in your dataset?
  5. Distribute: How will you share it back to us?

What is this class all about?

Sneak peek: class survey data

# A tibble: 10 × 3
   fun                                                class_year northfield_food
   <chr>                                              <chr>      <chr>          
 1 I love to go out to eat at new restaurants with m… Sophomore  Quarterback!   
 2 I like running, art/crafts, playing guitar, and l… Junior     <NA>           
 3 Mostly finance stuff 9reading blogs/watching vide… Junior     Red barn       
 4 Exercise!                                          Junior     Burton Dining …
 5 <NA>                                               Junior     the co-op      
 6 drawing                                            Junior     New Buffet     
 7 I used to skateboard a lot as a kid, although I s… Senior     Hogan Brothers.
 8 Cook lots of spicy food                            Sophomore  Desi Diner     
 9 I play video games, read, and watch movies and sh… Junior     Desi Diner     
10 Volleyball, read, pickleball, weightlifting.       Senior     Any of the foo…

You took a survey

Google saved your responses in a sheet

I read your data into R, cleaned it, and saved it as a CSV

Multiple choice question where you could only pick one option

What class year are you?

  • First year
  • Sophomore
  • Junior
  • Senior

Visualize

Code
survey |>
  count(class_year) |>
  mutate(prop = n/sum(n)) |>
  ggplot(aes(y = class_year, x = prop, fill = class_year)) + 
  geom_col(show.legend = FALSE) + 
  scale_x_continuous(labels = percent_format(accuracy = 1), breaks = c(0, .1, .2, .3, .4, .5)) + 
  labs(
    title = "Class year among Stat220 Students",
    y = "",
    x = "Proportion",
    caption = "Self-reported data collected from Stat220 students by 8pm on March 29"
  ) + 
  scale_fill_viridis_d(end = .75, option = "plasma")

Open-ended question

Where can you find the best food in Northfield?

survey$northfield_food
 [1] "New Buffet"                             
 [2] "Red barn"                               
 [3] "Desi Diner"                             
 [4] "Burton Dining Hall"                     
 [5] "Any of the food trucks outside Imminent"
 [6] "New Buffet"                             
 [7] "Hogan Brothers."                        
 [8] "Quarterback!"                           
 [9] NA                                       
[10] NA                                       
[11] "Desi Diner"                             
[12] "the co-op"                              

Visualize

Code
survey |>
  count(northfield_food) |>
  mutate(prop = n/sum(n)) |>
  ggplot(aes(y = northfield_food, x = prop, fill = northfield_food)) + 
  geom_col(show.legend = FALSE) + 
  scale_x_continuous(labels = percent_format(accuracy = 1), breaks = c(0, .1, .2, .3, .4, .5)) + 
  labs(
    title = "Where can you find the best food in Northfield?",
    y = "",
    x = "Proportion",
    caption = "Self-reported data collected from Stat220 students by 10am on Jan 5"
  ) + 
  scale_fill_viridis_d(end = .75, option = "plasma")

What do you do for fun?

Code
library(wordcloud)
library(tm)
library(NatParksPalettes)

word.corpus<-VCorpus(VectorSource(survey$fun)) #Corpus
word.corpus<-word.corpus%>%
  tm_map(removePunctuation)%>% ##eliminate punctuation
  tm_map(removeNumbers)%>% #no numbers
  tm_map(stripWhitespace)#white spaces
word.corpus <- tm_map(word.corpus, removeWords, c("the", "and","for","this","that","with","will","also","i'm")) 
word.corpus<-tm_map(word.corpus, stemDocument)
word.counts<-as.matrix(TermDocumentMatrix(word.corpus))
word.freq<-sort(rowSums(word.counts), decreasing=TRUE)
#head(word.freq)##what are the top words?
wordcloud(words=names(word.freq), freq=word.freq, scale=c(3,.5),max.words = 100, random.order = TRUE,
          min.freq = 1, color=natparks.pals("Torres"))

It’s easy when you start out programming to get really frustrated and think, “Oh it’s me, I’m really stupid,” or, “I’m not made out to program.” But, that is absolutely not the case. Everyone gets frustrated. I still get frustrated occasionally when writing R code. It’s just a natural part of programming. So, it happens to everyone and gets less and less over time. Don’t blame yourself. Just take a break, do something fun, and then come back and try again later.

R and RStudio

Heavily encouraging you to have your own local R and RStudio

  • You may have to install packages as we go - use install.packages function

  • You may have used Maize in the past

  • Okay to use that for today, but work on downloading R and RStudio

Syllabus highlights

Read the full syllabus by next class - on course website

Course website

  • access slides
  • see schedule
  • guides for installing R, RStudio, using GitHub and GitHub Desktop

Course github organization

  • access repositories for homework and projects

Office hours (tentative)

Day Time Type Location
Monday 2-3 Drop-in CMC 225
Tuesday 10:30-11:30 Appt CMC 225
Wednesday 11:30-12:30 Drop-in CMC 225
Friday 12-1 Drop-in CMC 225

Grading system

Homework and will be graded as successful, half credit, or not successful. Projects will be graded as excellent, successful, or not successful.

To earn a course grade, you must meet all of the requirements in a given row:

Homework Problems Portfolio Projects (4 total) Final Project
A 85% 2 Excellent + 2 Successful Excellent
B 75% 4 Successful Successful
C 65% 3 Successful Successful
D 50% 2 Successful Successful

“+” and “-” grades are determined by partially meeting the requirements in a given row.

Note: I expect daily attendance and participation. Missing >5 class meetings or consistent issues with being on-task will result in a 1/3 grade deduction.

Tokens

You get 3 tokens. You can use a token to:

  • Revise a portfolio project
  • 48-hour extension on a homework assignment or portfolio project submission (the request must be submitted before the deadline)

GitHub

https://github.com/stat220kurtz

  • GitHub organization for the course

  • All of your work and your membership (enrollment) in the organization is private

  • Each assignment is a private repo on GitHub, I distribute the assignments on GitHub.

  • You will work on your assignment, then “render ➡️ commit ✅ push ⤴️”

  • You’ll then be able to submit your PDF via gradescope

Fill out the Welcome Survey for collection of your account names, later this week you will be invited to the course organization.

Wrap up

Your tasks before next class

  1. Create a GitHub account if you don’t have one

  2. Complete the welcome survey if you haven’t already

  3. Read the syllabus

  4. Download or update your local R/RStudio versions

  5. Complete the readings for next class

  6. Download GitHub Desktop